package com.tydic.order.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tydic.order.domain.OrderSettlement;
import com.tydic.order.mapper.OrderSettlementMapper;
import com.tydic.order.service.IOrderSettlementService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@RequiredArgsConstructor
@Service
@Slf4j
public class OrderSettlementServiceImpl implements IOrderSettlementService {
    private final OrderSettlementMapper orderSettlementMapper;

    @Override
    public List<OrderSettlement> findByOrderId(String orderId) {
        return orderSettlementMapper.selectList(Wrappers.lambdaQuery(OrderSettlement.class).eq(OrderSettlement::getOrderId, orderId));
    }

    @Override
    public List<OrderSettlement> getOrderSettlements(String orderId) {
        return findByOrderId(orderId);
    }
}
